package cn.yunhe.action;

import cn.yunhe.util.BaseUtil;
import lombok.Data;

import java.io.IOException;
import java.io.PrintWriter;

@Data
public class JisuanAction extends BaseUtil {
    private double firstNum;
    private double nextNum;
    private double result;
    PrintWriter out = null;

    public void jia() throws IOException {
        out=getResponse().getWriter();
        result = firstNum + nextNum;
        out.print(result);
    }

    public void jian() throws IOException {
        out=getResponse().getWriter();
        result = firstNum - nextNum;
        out.print(result);
    }

    public void cheng() throws IOException {
        out=getResponse().getWriter();
        result = firstNum * nextNum;
        out.print(result);
    }

    public void chu() throws IOException {
        out=getResponse().getWriter();
        result = firstNum / nextNum;
        out.print(result);
    }
}
